function randomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}

$(document).ready(function () {    
  
    $('#blogfeed').rssfeed('http://feeds.feedburner.com/lekman?format=xml&k=' + randomString(), {
        limit: 10,
        content: true,
        header: false,
        date: false,
        titletag: 'h4',
	    key: 'ABQIAAAATyV7A1tghAUvOXa3xJLbeBSCYvT-07RqoRGQsoKK7t7LDMvfHxR42nckZ6pMkp_RYvf8ZrBRyOSnqQ',
        errormsg: 'An error has occurred. Please navigate to <a href="http://blog.lekman.com">Blog</a> using the main menu for latest blog updates.'
    });
    setTimeout(function () {
        setNewWin();
        setTimeout("setNewWin()", 1000);
    }, 1000);
    setTimeout("checkTwitter()", 2000);
});

function setNewWin() {
    $("ul.tweet_list a").attr("target", "_blank");
    $("ul.tweet_list a").attr("title", "Opens in a new window");
}

function checkTwitter() {
	var x = ($("twitterfeed").text());
}